@import "common/var";

$default-padding: 1rem;
$large-padding: 1rem;
$medium-padding: 0.8rem;
$small-padding: 0.5rem;

@include b(panel) {
  box-sizing: border-box;
  position: relative;

  > .el-card__header {
    padding: 0;
  }
  > .el-card__body {
    padding: 0;
  }


  @include e(header) {
    > .my-header {
      margin-bottom: 0;
    }
  }

  @include e(body) {
    padding: $default-padding;
    box-sizing: border-box;
    @include when(fit) {
      overflow: auto;
    }
  }

  @include e(footer) {
    padding: $default-padding;
    box-sizing: border-box;
    @include when(left) {
      text-align: left;
    }
    @include when(center) {
      text-align: center;
    }
    @include when(right) {
      text-align: right;
    }
    @include when(border-top) {
      border-top: 1px solid $--color-table-header;
    }
    @include when(flag) {
      border-top: 1px solid $--color-table-header;
    }
  }

  @include when(fit) {
    height: 100%;
  }

  @include when(no-border) {
    border-color: transparent;
  }

  @include m(flag) {
    > .el-card__header {
      border-bottom: 0;

      .my-title__content {
        left: 1rem;
      }
    }

  }

  @include m(background) {
    > .el-card__header {
      border-bottom: 0;
    }
  }

  @include m(border-top) {
    &::before {
      content: '';
      border-top: $--border-radius-base solid $--color-primary;
      width: 100%;
      position: absolute;
      left: 0;
      top: 0;
      border-radius: $--border-radius-base $--border-radius-base 0 0;
    }

    > .el-card__header {
      border-bottom: 0;
    }
  }

  @include when(large) {
    @include e(body) {
      padding: $large-padding;
    }
    @include e(footer) {
      padding: $large-padding;
    }
  }

  @include when(medium) {
    @include e(body) {
      padding: $medium-padding;
    }
    @include e(footer) {
      padding: $medium-padding;
    }
  }

  @include when(small) {
    @include e(body) {
      padding: $small-padding;
    }
    @include e(footer) {
      padding: $small-padding;
    }
  }
}

.my-panel + .my-panel {
  margin-top: 1rem;
}
